<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../lib/jquery.min.js"></script>
    <script src="../lib/template-web.js"></script>
</head>

<body>
    <div id="container"></div>

    <script type="text/html" id="tpl-user">
        <h1>{{name}} ------ {{age}}</h1>
    </script>

    <script>
        let data = { name: "zhangSan", age: 20 };
        let htmlStr = template("tpl-user", data);

        $("#container").html(htmlStr);
    </script>
</body>

</html>